package com.ffapp.demo.bean;


import android.text.TextUtils;

import com.alibaba.fastjson.annotation.JSONField;
import com.amap.api.maps.model.LatLng;
import com.amap.api.navi.model.NaviLatLng;
import com.ffapp.demo.R;
import com.ffapp.demo.greendao.GreenDaoUtils;
import com.ffapp.demo.map.GPSUtil;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Index;

import java.io.Serializable;

import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Transient;

@Entity(indexes = {@Index(value = "id,map_type", unique = true)})
public class WarnMapData  implements Serializable {
    /**
     *
     */
    private static final long serialVersionUID = 1L;

    public static final String WATER_TYPE_HYDRANT ="0",WATER_TYPE_POOL = "1",WATER_TYPE_WATER = "2";
    public static final String SATUS_USE ="1",SATUS_DISABLE = "0";


    //用到了这个Convert注解，表明它们的转换类，这样就可以转换成String保存到数据库中了
//    @Convert(columnType = String.class, converter = WarnMapProfileBeanConverter.class)
//    private ProfileBean profile;
    private String profile;

    public String getPlateNo() {
        return plateNo;
    }

    public void setPlateNo(String plateNo) {
        this.plateNo = plateNo;
    }

    private String plateNo ="无车牌号";
    private String isSuper;
    private String longitude;
    private String remark;
    private String pumperNo;
    private String createUserName;
    private String simId;
    private String updateBy;
    private String deptId;
    private String icoPath;
//    @Index(unique = true)//设置唯一性
    private String id;
    private String areaName;
    private String updateTime;
    private String createTime;
    private String pumperId;
    private String latitude;
    private String name;
    private String updateUserName;
    private String deptName;
    private String type;
    private String createBy;
    private int angle;
    private String status;
   //  @Transient不写入数据库
    private boolean online = false;   //在线状态，true：在线，false：离线

    private String map_type;
//    @Id(autoincrement = true)
//    private long map_id;

    private String linkId;
    @Transient //不写入数据库
    private String speed;


    @Transient //不写入数据库
    private String shortName;


    @JSONField(serialize = false)
    public String getStatusName(){
        if(TextUtils.isEmpty(status)){
            return null;
        }
        switch (status){
            case "0":
                return "不可用";
            default:
                return "可用";
        }
    }
    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getShortName() {
        return shortName;
    }

    public void setShortName(String shortName) {
        this.shortName = shortName;
    }


    public String getIsSuper() {
        return isSuper;
    }

    public void setIsSuper(String isSuper) {
        this.isSuper = isSuper;
    }

    public String getLongitude() {
        return longitude;
    }

    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getPumperNo() {
        return pumperNo;
    }

    public void setPumperNo(String pumperNo) {
        this.pumperNo = pumperNo;
    }

    public String getCreateUserName() {
        return createUserName;
    }

    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }

    public String getSimId() {
        return simId;
    }

    public void setSimId(String simId) {
        this.simId = simId;
    }

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public String getDeptId() {
        return deptId;
    }

    public void setDeptId(String deptId) {
        this.deptId = deptId;
    }

    public String getIcoPath() {
        return icoPath;
    }

    public void setIcoPath(String icoPath) {
        this.icoPath = icoPath;
    }

    public String getId() {
        if(TextUtils.isEmpty(id))return "";
        return id;
    }

    public boolean isOnline() {
        return online;
    }

    public void setOnline(boolean online) {
        this.online = online;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getAreaName() {
        return areaName;
    }

    public void setAreaName(String areaName) {
        this.areaName = areaName;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getPumperId() {
        return pumperId;
    }

    public void setPumperId(String pumperId) {
        this.pumperId = pumperId;
    }

    public String getLatitude() {
        return latitude;
    }

    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUpdateUserName() {
        return updateUserName;
    }

    public void setUpdateUserName(String updateUserName) {
        this.updateUserName = updateUserName;
    }

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public String getType() {
        return type;
    }

    @JSONField(serialize = false)
    public String getTypeName() {
        switch (map_type) {
            case  GreenDaoUtils.TYPE_CAR:
            case  GreenDaoUtils.TYPE_RECAR:
                return "消防车";
            case  GreenDaoUtils.TYPE_STATION:
                return "微型消防站";
            case  GreenDaoUtils.TYPE_WATER:
                return "消火栓";
            case  GreenDaoUtils.TYPE_PERSON:
                return "人员";
            case  GreenDaoUtils.TYPE_UNIT:
                return "单位";
            case  GreenDaoUtils.TYPE_SQUADRON:
                return "消防大队";
            default:
                return "单位";
        }
    }

    public NaviLatLng getNaviLatLng() {
        if (TextUtils.isEmpty(latitude) || TextUtils.isEmpty(latitude)) {
            return null;
        }

        double[] gprs = GPSUtil.gps84_To_Gcj02(Double.valueOf(latitude),Double.valueOf(longitude));

        NaviLatLng latLng = new NaviLatLng(gprs[0], gprs[1]);
        return latLng;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public int getAngle() {
        return angle;
    }

    public void setAngle(int angle) {
        this.angle = angle;
    }

    @JSONField(serialize = false)
    public int getMapMarkerResid() {
        switch (map_type) {
            case  GreenDaoUtils.TYPE_CAR:
            case  GreenDaoUtils.TYPE_RECAR:
                if(isOnline()){
                    return R.drawable.map_car;
                }else {
                    return R.drawable.map_car_b;
                }
            case  GreenDaoUtils.TYPE_STATION:
                return R.drawable.map_icon_station;
            case  GreenDaoUtils.TYPE_WATER:
                return R.drawable.map_icon_map_icon_map_icon_fire;
            case  GreenDaoUtils.TYPE_PERSON:
                if(isOnline()){
                    return R.drawable.map_icon_personnel;
                }else {
                    return R.drawable.map_icon_per_n;
                }
            case  GreenDaoUtils.TYPE_SQUADRON:
                return R.drawable.map_icon_oon;
            default:
                return R.drawable.map_icon_unit;
        }
    }

    /*
    * Gcj02的坐标系，高德坐标系
    * */
    @JSONField(serialize = false)
    public LatLng getLatlng() {
        if (TextUtils.isEmpty(latitude) || TextUtils.isEmpty(longitude)) {
            return new LatLng(0, 0);
        }

        double[] gprs = GPSUtil.gps84_To_Gcj02(Double.valueOf(latitude),Double.valueOf(longitude));
        LatLng latLng = new LatLng(gprs[0], gprs[1]);
        return latLng;
    }

    /*
     * Gcj02的坐标系，高德坐标系
     * */
    @JSONField(serialize = false)
    public LatLng getLatlng84() {
        if (TextUtils.isEmpty(latitude) || TextUtils.isEmpty(longitude)) {
            return new LatLng(0, 0);
        }

//        double[] gprs = GPSUtil.gps84_To_Gcj02(Double.valueOf(latitude),Double.valueOf(longitude));
        LatLng latLng = new LatLng(Double.valueOf(latitude), Double.valueOf(longitude));
        return latLng;
    }


    @JSONField(serialize = false)
    public LatLng getLatlngOfHydrant() {
        if (TextUtils.isEmpty(latitude) || TextUtils.isEmpty(latitude)) {
            return new LatLng(0, 0);
        }

        double[] gprs = GPSUtil.gps84_To_Gcj02_Of_hydrant(Double.valueOf(latitude),Double.valueOf(longitude));
        LatLng latLng = new LatLng(gprs[0], gprs[1]);
        return latLng;
    }


    private String brigadeType;
    private String phone ="";
    private String no;
    private String address;
    private String managerName;
    private String managerPhone;
    private String contactName;
    private String contactPhone;
    private String buildTime;
    private String unitName;
    private String buildType;
    private String area;
    private String dutyPhone;
    private String geoRange;
    private int vechCount;
    private int mobiCount;
    private int fireeCount;
    private int bagCount;
    private int gunCount;
    private int helmetCount;
    private int ptcolCount;
    private int bootCount;
    private long teloutCount;
    private int intercomCount;
    private String equmo;
    private String collectUserId;
    private String collectUserName;
    private String collectTime;
    private int outState;
    private String auditStatus;
    private String auditMessage;
    private int updateStatus;
    private int version;
    private String deleted;
    private String distance;
    private String exteriorAtts;
    private String exteriorFileIds;
    private String carEquAtts;
    private String carEquFileIds;
    private String staffAtts;
    private String staffFileIds;
    private String otherAtts;
    private String otherFileIds;

    public String getManagerPhone() {
        return managerPhone;
    }

    public void setManagerPhone(String managerPhone) {
        this.managerPhone = managerPhone;
    }

    public String getContactName() {
        return contactName;
    }

    public void setContactName(String contactName) {
        this.contactName = contactName;
    }

    public String getContactPhone() {
        return contactPhone;
    }

    public void setContactPhone(String contactPhone) {
        this.contactPhone = contactPhone;
    }

    public String getBuildTime() {
        return buildTime;
    }

    public void setBuildTime(String buildTime) {
        this.buildTime = buildTime;
    }

    public String getUnitName() {
        return unitName;
    }

    public void setUnitName(String unitName) {
        this.unitName = unitName;
    }

    public String getBuildType() {
        return buildType;
    }

    public void setBuildType(String buildType) {
        this.buildType = buildType;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public String getDutyPhone() {
        return dutyPhone;
    }

    public void setDutyPhone(String dutyPhone) {
        this.dutyPhone = dutyPhone;
    }

    public String getGeoRange() {
        return geoRange;
    }

    public void setGeoRange(String geoRange) {
        this.geoRange = geoRange;
    }

    public int getVechCount() {
        return vechCount;
    }

    public void setVechCount(int vechCount) {
        this.vechCount = vechCount;
    }

    public int getMobiCount() {
        return mobiCount;
    }

    public void setMobiCount(int mobiCount) {
        this.mobiCount = mobiCount;
    }

    public int getFireeCount() {
        return fireeCount;
    }

    public void setFireeCount(int fireeCount) {
        this.fireeCount = fireeCount;
    }

    public int getBagCount() {
        return bagCount;
    }

    public void setBagCount(int bagCount) {
        this.bagCount = bagCount;
    }

    public int getGunCount() {
        return gunCount;
    }

    public void setGunCount(int gunCount) {
        this.gunCount = gunCount;
    }

    public int getHelmetCount() {
        return helmetCount;
    }

    public void setHelmetCount(int helmetCount) {
        this.helmetCount = helmetCount;
    }

    public int getPtcolCount() {
        return ptcolCount;
    }

    public void setPtcolCount(int ptcolCount) {
        this.ptcolCount = ptcolCount;
    }

    public int getBootCount() {
        return bootCount;
    }

    public void setBootCount(int bootCount) {
        this.bootCount = bootCount;
    }

    public long getTeloutCount() {
        return teloutCount;
    }

    public void setTeloutCount(long teloutCount) {
        this.teloutCount = teloutCount;
    }

    public int getIntercomCount() {
        return intercomCount;
    }

    public void setIntercomCount(int intercomCount) {
        this.intercomCount = intercomCount;
    }

    public String getEqumo() {
        return equmo;
    }

    public void setEqumo(String equmo) {
        this.equmo = equmo;
    }

    public String getCollectUserId() {
        return collectUserId;
    }

    public void setCollectUserId(String collectUserId) {
        this.collectUserId = collectUserId;
    }

    public String getCollectUserName() {
        return collectUserName;
    }

    public void setCollectUserName(String collectUserName) {
        this.collectUserName = collectUserName;
    }

    public String getCollectTime() {
        return collectTime;
    }

    public void setCollectTime(String collectTime) {
        this.collectTime = collectTime;
    }

    public int getOutState() {
        return outState;
    }

    public void setOutState(int outState) {
        this.outState = outState;
    }

    public String getAuditStatus() {
        return auditStatus;
    }
    public boolean getAuditStatus_BOOLEAN() {
        if(TextUtils.isEmpty(auditStatus))return false;
        return auditStatus.equals("1");
    }

    public void setAuditStatus(String auditStatus) {
        this.auditStatus = auditStatus;
    }

    public String getAuditMessage() {
        return auditMessage;
    }

    public void setAuditMessage(String auditMessage) {
        this.auditMessage = auditMessage;
    }

    public int getUpdateStatus() {
        return updateStatus;
    }

    public void setUpdateStatus(int updateStatus) {
        this.updateStatus = updateStatus;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public String getDeleted() {
        return deleted;
    }

    public void setDeleted(String deleted) {
        this.deleted = deleted;
    }

    public String getDistance() {
        return distance;
    }

    public void setDistance(String distance) {
        this.distance = distance;
    }

    public String getExteriorAtts() {
        return exteriorAtts;
    }

    public void setExteriorAtts(String exteriorAtts) {
        this.exteriorAtts = exteriorAtts;
    }

    public String getExteriorFileIds() {
        return exteriorFileIds;
    }

    public void setExteriorFileIds(String exteriorFileIds) {
        this.exteriorFileIds = exteriorFileIds;
    }

    public String getCarEquAtts() {
        return carEquAtts;
    }

    public void setCarEquAtts(String carEquAtts) {
        this.carEquAtts = carEquAtts;
    }

    public String getCarEquFileIds() {
        return carEquFileIds;
    }

    public void setCarEquFileIds(String carEquFileIds) {
        this.carEquFileIds = carEquFileIds;
    }

    public String getStaffAtts() {
        return staffAtts;
    }

    public void setStaffAtts(String staffAtts) {
        this.staffAtts = staffAtts;
    }

    public String getStaffFileIds() {
        return staffFileIds;
    }

    public void setStaffFileIds(String staffFileIds) {
        this.staffFileIds = staffFileIds;
    }

    public String getOtherAtts() {
        return otherAtts;
    }

    public void setOtherAtts(String otherAtts) {
        this.otherAtts = otherAtts;
    }

    public String getOtherFileIds() {
        return otherFileIds;
    }

    public void setOtherFileIds(String otherFileIds) {
        this.otherFileIds = otherFileIds;
    }
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }


    private String fullName;  //消防车辆名称+几班
    private String isSetup;  //是否有安装设备

    @Generated(hash = 2121877324)
    public WarnMapData(String profile, String plateNo, String isSuper, String longitude, String remark,
            String pumperNo, String createUserName, String simId, String updateBy, String deptId, String icoPath,
            String id, String areaName, String updateTime, String createTime, String pumperId, String latitude,
            String name, String updateUserName, String deptName, String type, String createBy, int angle,
            String status, boolean online, String map_type, String linkId, String brigadeType, String phone,
            String no, String address, String managerName, String managerPhone, String contactName,
            String contactPhone, String buildTime, String unitName, String buildType, String area,
            String dutyPhone, String geoRange, int vechCount, int mobiCount, int fireeCount, int bagCount,
            int gunCount, int helmetCount, int ptcolCount, int bootCount, long teloutCount, int intercomCount,
            String equmo, String collectUserId, String collectUserName, String collectTime, int outState,
            String auditStatus, String auditMessage, int updateStatus, int version, String deleted,
            String distance, String exteriorAtts, String exteriorFileIds, String carEquAtts, String carEquFileIds,
            String staffAtts, String staffFileIds, String otherAtts, String otherFileIds, String fullName,
            String isSetup) {
        this.profile = profile;
        this.plateNo = plateNo;
        this.isSuper = isSuper;
        this.longitude = longitude;
        this.remark = remark;
        this.pumperNo = pumperNo;
        this.createUserName = createUserName;
        this.simId = simId;
        this.updateBy = updateBy;
        this.deptId = deptId;
        this.icoPath = icoPath;
        this.id = id;
        this.areaName = areaName;
        this.updateTime = updateTime;
        this.createTime = createTime;
        this.pumperId = pumperId;
        this.latitude = latitude;
        this.name = name;
        this.updateUserName = updateUserName;
        this.deptName = deptName;
        this.type = type;
        this.createBy = createBy;
        this.angle = angle;
        this.status = status;
        this.online = online;
        this.map_type = map_type;
        this.linkId = linkId;
        this.brigadeType = brigadeType;
        this.phone = phone;
        this.no = no;
        this.address = address;
        this.managerName = managerName;
        this.managerPhone = managerPhone;
        this.contactName = contactName;
        this.contactPhone = contactPhone;
        this.buildTime = buildTime;
        this.unitName = unitName;
        this.buildType = buildType;
        this.area = area;
        this.dutyPhone = dutyPhone;
        this.geoRange = geoRange;
        this.vechCount = vechCount;
        this.mobiCount = mobiCount;
        this.fireeCount = fireeCount;
        this.bagCount = bagCount;
        this.gunCount = gunCount;
        this.helmetCount = helmetCount;
        this.ptcolCount = ptcolCount;
        this.bootCount = bootCount;
        this.teloutCount = teloutCount;
        this.intercomCount = intercomCount;
        this.equmo = equmo;
        this.collectUserId = collectUserId;
        this.collectUserName = collectUserName;
        this.collectTime = collectTime;
        this.outState = outState;
        this.auditStatus = auditStatus;
        this.auditMessage = auditMessage;
        this.updateStatus = updateStatus;
        this.version = version;
        this.deleted = deleted;
        this.distance = distance;
        this.exteriorAtts = exteriorAtts;
        this.exteriorFileIds = exteriorFileIds;
        this.carEquAtts = carEquAtts;
        this.carEquFileIds = carEquFileIds;
        this.staffAtts = staffAtts;
        this.staffFileIds = staffFileIds;
        this.otherAtts = otherAtts;
        this.otherFileIds = otherFileIds;
        this.fullName = fullName;
        this.isSetup = isSetup;
    }

    @Generated(hash = 607926896)
    public WarnMapData() {
    }

    public String getFullName() {
        return fullName;
    }

    public void setFullName(String fullName) {
        this.fullName = fullName;
    }

    public String getIsSetup() {
        return isSetup;
    }

    public void setIsSetup(String isSetup) {
        this.isSetup = isSetup;
    }


    public String getBrigadeType() {
        return this.brigadeType;
    }

    public void setBrigadeType(String brigadeType) {
        this.brigadeType = brigadeType;
    }

    public String getNo() {
        return this.no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public String getAddress() {
        return this.address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getManagerName() {
        return this.managerName;
    }

    public void setManagerName(String managerName) {
        this.managerName = managerName;
    }


    public String getProfile() {
        return profile;
    }

    public void setProfile(String profile) {
        this.profile = profile;
    }

    public String getMap_type() {
        return map_type;
    }

    public void setMap_type(String map_type) {
        this.map_type = map_type;
    }

//    public long getMap_id() {
//        return map_id;
//    }
//
//    public void setMap_id(long map_id) {
//        this.map_id = map_id;
//    }

    public String getLinkId() {
        return linkId;
    }

    public void setLinkId(String linkId) {
        this.linkId = linkId;
    }

    public boolean getOnline() {
        return this.online;
    }

    public String getSpeed() {
        return speed;
    }

    public void setSpeed(String speed) {
        this.speed = speed;
    }
}
